package cn.antho.shop.service.impl;

import cn.antho.shop.domain.Product;
import cn.antho.shop.mapper.ProductMapper;
import cn.antho.shop.service.IProductService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author director
 * @since 2022-11-18
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public Product getByProductId(Long pid) {
        return productMapper.getByProductId(pid);
    }

    @Override
    public void add(Long id) {
        productMapper.add(id);
    }

    @Override
    public List<Product> selectStockoutList() {
        List<Product> products = productMapper.selectStockoutList();
        System.out.println(products);
        return products;
    }
}
